/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Model;

/**
 *
 * @author snowangelic
 */
public class AttributeValue<T>{
    //Action action;
    Attribute attribute;
    T value;
    T normalizedValue;

    AttributeValue(Action a,Attribute attr,T val){
        //action=a;
        attribute=attr;
        value=val;
        normalizedValue=null;
    }
    /**
     *
     * @param a
     */
    public void setAction(Action a){
        //action=a;
    }

    /**
     *
     * @return
     */
    /*
    public Action getAction(){
        return action;
    }
     * */

    /**
     *
     * @return
     */
    public Attribute getAttribute(){
        return attribute;
    }

    public T getValue(boolean normalized){
        if(normalized) return getNormalizedValue();
        else return value;
    }

    public T getValue(){
        return value;
    }

    public void setValue(T val){
        value=val;
    }

    public void setNormalizedValue(T val){
        normalizedValue=val;
    }

    public T getNormalizedValue(){
        if(normalizedValue==null){
            return value;
        }
        else return normalizedValue;
    }
}
